/**
 * Created by fangshufeng on 2018/4/22.
 */
import  React from 'react'

import GlobalRouter from  './globalRouter';
import {EnvSelect} from '../component/'
import {DashBoard, QRCodeView} from '../conntainer'

import {
    Route,
    Switch,
    BrowserRouter
}  from 'react-router-dom';

class Utility extends React.Component {

    componentWillUnmount() {
        console.log('Utility componentWillUnmount ');
    }

    render() {
        return <BrowserRouter basename={process.env.PUBLIC_URL}>
            <div>
                <GlobalRouter/>
                <Switch>
                    <Route path="/dashboard" exact component={DashBoard}/>
                    <Route path="/envSelect" exact component={EnvSelect}/>
                    <Route path="/bindDevice" exact component={QRCodeView}/>
                    <Route component={() => <h2>NOT FOUND</h2>}/>
                </Switch>
            </div>
        </BrowserRouter>
    }
}

export default Utility;